package cn.mafangui.hotel.controller.worker;

import cn.mafangui.hotel.entity.User;
import cn.mafangui.hotel.entity.Worker;
import cn.mafangui.hotel.response.AjaxResult;
import cn.mafangui.hotel.response.ResponseTool;
import cn.mafangui.hotel.service.WorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/admin")
public class AdminController {
    @Autowired
    WorkerService workerService;

    @RequestMapping(value = "/{username}",method = RequestMethod.POST)
    public AjaxResult getProfile(@PathVariable String username){
        Worker worker = workerService.selectByUsername(username);
        return ResponseTool.success(worker);
    }

}
